package com.umeox.watch.moto.chat.widget;


import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.umeox.moto.watch.themes.widget.ImageView;
import com.umeox.watch.moto.chat.R;

public class SunmitDialog extends Dialog {

    private TextView tvDesc;

    public SunmitDialog(@NonNull Context context) {
        super(context);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_submit);
        tvDesc = findViewById(R.id.tv_desc);
        ImageView ivSubmit = findViewById(R.id.iv_submit);
        ivSubmit.setOnClickListener(v -> {
            if (mListener != null) {
                mListener.onSubmit();
            }
        });
    }

    @Override
    public void dismiss() {
        super.dismiss();
    }

    public void setTitle(String text) {
        tvDesc.setText(text);
    }

    private OnDialogActionListener mListener;

    public void setListener(OnDialogActionListener listener) {
        mListener = listener;
    }

    public interface OnDialogActionListener {
        void onSubmit();

    }
}
